package net.wofly.sale.commodity.service;

import java.util.List;

import org.springframework.data.jpa.repository.Query;

import net.wofly.framework.util.ReturnBean;
import net.wofly.sale.commodity.domain.Commodity;
import net.wofly.sale.commodity.domain.CommodityChannel;

/**
 * @author siqingwei
 */
public interface ICommodityChannelService {

	/**
	 * 增加或修改
	 * 
	 * @param entity
	 * @return
	 */
	CommodityChannel save(CommodityChannel entity);

	/**
	 * 删除
	 * 
	 * @param entity
	 * @return
	 */
	void delete(CommodityChannel entity);

	/**
	 * 根据主键ID删除
	 * 
	 * @param key
	 * @return
	 */
	void delete(String key);

	/**
	 * 根据主键查询
	 * 
	 * @param key
	 * @return
	 */
	CommodityChannel findOne(String key);
	
	List<CommodityChannel> save(List<CommodityChannel> entityList) ;

	ReturnBean<CommodityChannel> addCommodityChannel(CommodityChannel commodityChannel);

	ReturnBean<CommodityChannel> updateCommodityChannel(CommodityChannel commodityChannel);

	List<CommodityChannel> findByCommodityID(String commodityID);

	CommodityChannel findByCommodityIDAndChannel(String commodityID, String channel);

	ReturnBean<List<CommodityChannel>> addCommodityChannels(List<CommodityChannel> commodityChannelList);

	ReturnBean<List<CommodityChannel>> updateCommodityChannels(Commodity commodity);
	
	/**
	 * 
	 * 
	 * @param commodityChannel
	 * @return
	 */
	ReturnBean<List<CommodityChannel>> getAllCommodityChannelList();

	String findCommodityNameByCommodityChannelID(String commodityChannelID);
	
	public void delByCommodityID(String commodityID) ;
	
	public ReturnBean<List<CommodityChannel>> getCommodityChannelByOrderType(String orderType) ;
}
